package com.aistar.hotel.mapper;


import com.aistar.hotel.entity.HotelRoom;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


/**
 * Created by wubin on 2019/6/23.
 */
public interface HotelRoomMapper {
    @Select("select * from hotelroom where hotelroom_name like hotelroom_name('%',#{hotelroom_name},'%')")
    List<HotelRoom> findAll(String roomname);

    @Select("select * from hotelroom where hotelroom_id=#{id}")
    HotelRoom findById(String id);

    @Insert("insert into hotelroom values(#{hotelroomId},#{hotelroomName},#{hotelroomRooms},#{hotelroomSize},#{hotelroomPrice})")
    void save(HotelRoom hotelRoom);

    @Delete("delete from hotelroom where hotelroom_id=#{id}")
    void delete(String id);

    @Update("update hotelroom set hotelroom_name=#{hotelroomName},hotelroom_price=#{hotelroomPrice} where hotelroom_id=#{hotelroomId}")
    void update(HotelRoom hotelRoom);
}
